#ifndef STUDENT_H
#define STUDENT_H
#include "stdafx.h"
#include <iostream>
#include <string>
#include <valarray>

class Student
{
private:
	typedef std::valarray<double> ArrayDb;
	std::string name;
	ArrayDb score;
	std::ostream & arr_out(std::ostream & os)const;
public:
	Student():name("Null Student"),score(){};
	Student(const std::string &s):name(s),score(){};
	explicit Student(int n):name("Nully"),score(n){};
	Student(const std::string &s,const ArrayDb & a):name(s),score(a){};
	Student(const char *str,const double *pd,int n):
		name(str),score(pd,n){};
	~Student();
	double Average()const;
	const std::string & Name()const;
	double & operator[](int i);
	double operator[](int i)const;

	friend std::istream & operator>>(std::istream &is,Student &st);
	friend std::istream & getline(std::istream &is,Student &st);
	friend std::ostream & operator<<(std::ostream &os,const Student &st);
}

#endif